package com.bkitmobile.kesu.android.GUI;

import java.util.LinkedList;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.text.Html;

import com.bkitmobile.kesu.android.connectServer.*;

public class AcceptInviteDlg  {
	
	private FriendsList context;
	private String uDest;
	private Builder dlg;
	private String cmt;
	public AcceptInviteDlg(FriendsList context,String uDest
			,String cmt) {
		this.context = context;
		this.uDest = uDest;
		this.cmt = cmt;
		String message = "Do you want to add <b><font color=\"#3399ff\">"+uDest+"</font></b> to your friends list?";
		if(cmt != null && cmt.length() > 0)
			message += "\n Message: \n" + this.cmt;
		dlg = new AlertDialog.Builder(context)
        .setTitle("Confirm message")
        .setMessage(Html.fromHtml(message))
        .setPositiveButton("Yes", new OnClickListener() {
			
				public void onClick(DialogInterface dialog, int which) {
					// TODO Auto-generated method stub
					staticClass.socket.println("<accept>"+AcceptInviteDlg.this.uDest);
				}
			}
        )
        .setNegativeButton("No", new OnClickListener() {
			
			public void onClick(DialogInterface dialog, int which) {
				// TODO Auto-generated method stub
				staticClass.socket.println("<deny>"+AcceptInviteDlg.this.uDest);
			}
        }
        );
	}
	public void show()
	{
		dlg.show();
	}
}
